package com.xjtu.mybatisplus.web.controller;

import com.xjtu.mybatisplus.common.JsonResponse;
import com.xjtu.mybatisplus.service.StaticService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/admin/static")
@Api(tags = "首页统计接口")
public class StaticController {

    @Autowired
    StaticService staticService;

    @GetMapping("article")
    @ApiOperation("文章总数")
    public JsonResponse getArticle() {
        return staticService.getArticle();
    }

    @GetMapping("comment")
    @ApiOperation("评论总数")
    public JsonResponse getComment() {
        return staticService.getComment();
    }

    @GetMapping("fav")
    @ApiOperation("点赞总数")
    public JsonResponse getFav() {
        return staticService.getFav();
    }

}
